<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>Demo_1</title>

</head>

<body>
    
<?php

    echo "<h1>开始</h1>";
    
    //直接使用常量
    define('TIREPRICES', 101);
    echo TIREPRICES;

//运算符    
    $a = 1;
    $b = 2;
    $c = $a;
    //$a = ++$a;
    $result = $a.$b;
    //echo "<br />".$result;
    //echo "<br />".++$a;
    echo "<br />a=".$a;
    echo "<br />c=".$c;
    echo "<br />a=".$a;
    
    //$a = @(57/0);//错误抑制操作符，
    
    echo "<h1>测试变量状态</h1>";
    echo gettype($a).'<br />';
    settype($a,'array');
    echo gettype($a).'<br />';
    
    
    echo 'isset($tireqty): '.isset($tireqty).'<br />';
    echo 'isset($nothere): '.isset($nothere).'<br />';
    echo 'empty($tireqty): '.empty($tireqty).'<br />';
    echo 'empty($nothere): '.empty($nothere).'<br />';
    
    
    echo "<h1>while循环</h1>";
    $num = 1;
    while ($num <= 5) {
        echo $num."<br />";
        $num++;
    }
    
    echo "<h1>等于（ == ）和恒等于（ === ）的区别</h1>";
    
    $str = "0hhh";//弱类型语言，判断变量类型用。
if (0 == $str) {//执行关系运算”==“时要求运算符两边的数据类型必须一致，所以等号右边的字符串被强制 转换为了整型0
	echo "true ";
}else{
	echo "false ";
}

    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
?>

</body>
</html>
